package com.gitee.wsl.transform.encode.pinyin.trie

/***
 * PayloadToken holds a text ("the fragment") an emits some output. If
 * [.isMatch] returns `true`, the token matched a search term.
 *
 * @author Daniel Beck
 *
 * @param <T> The Type of the emitted payloads.
</T> */
abstract class PayloadToken<T>(val fragment: String) {
    /**
     * Return `true` if a search term matched.
     * @return `true` if this is a match
     */
    abstract val isMatch: Boolean

    /**
     * @return the payload
     */
    abstract val emit: PayloadEmit<T>?
}
